// class 关键字

// function Person(name) {
//     this.name = name
// }

// Person.prototype.say = function () {
//     console.log(`hi my name is ${this.name}`)
// }

class Person {
    constructor(name) {
        this.name = name;
    }

    say() {
        console.log(`hi my name is ${this.name}`);
    }
}

const p = new Person('tom');

p.say();
